package com.musicstore.entity;

import java.math.BigDecimal;

//购物车项
public class CartItem {

	private int id;
	private String title; //名称
	private BigDecimal  price;
	private int quantity; //数量
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public BigDecimal getPrice() {
		return price;
	}
	public void setPrice(BigDecimal price) {
		this.price = price;
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	//小计=价格*数量
	public BigDecimal  getSubTotal(){
		return price.multiply(new BigDecimal(quantity));
	}
}

